package com.abc.robot01.room.bean

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey

/**
 * @author qiandu
 */
@Entity(tableName = ChatAnswerBean.TABLE_NAME)
data class ChatAnswerBean(

    @ColumnInfo(name = "id")
    @PrimaryKey(autoGenerate = true)
    val id: Int = 0,

    @ColumnInfo(name = "cmd_id")
    var cmd_Id: String = "",

    @ColumnInfo(name = "data")
    var date: String = "",

    @ColumnInfo(name =  "soundpath")
    var soundPath: String = "",

    @ColumnInfo(name = "actionid")
    var actionId: String = "",

    @ColumnInfo(name = "eyemotionid")
    var eyemotionId: String = "",

    @ColumnInfo(name = "padid")
    var padId: String = "",
    @ColumnInfo(name = "ttstext")
    var ttsText: String = "",

    @ColumnInfo(name = "type", defaultValue = "0")
    var type: Int = 0,

    @ColumnInfo(name = "imgpath")
    var imgpath: String = ""
) {
    fun setAnswer(cmd_Id: String, answerBean: ChatAnswerBean) {
        this.cmd_Id = cmd_Id
        this.padId = answerBean.padId
        this.actionId = answerBean.actionId
        this.eyemotionId = answerBean.eyemotionId
        this.soundPath = answerBean.soundPath
        this.ttsText = answerBean.ttsText
        this.type = answerBean.type
        this.imgpath = answerBean.imgpath
    }

    companion object {

        const val TABLE_NAME = "chat_answer"
    }
}
